package chars;

import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.nio.charset.Charset;

public class ReaderTest2 {

	public static void main(String[] args) throws IOException {
		
		System.out.println( Charset.defaultCharset().name() );
		
		// 创建一个可以 "以字符为单位" 来读取指定文件中内容的输入流
		// Reader r = new FileReader( "GBK-OutputStreamTest2.java" );
		Reader r = new FileReader( "src/chars/ReaderTest2.java" );
		
		int c ;
		while( ( c = r.read() ) != -1 ) {
			System.out.print( (char) c );
		}
		
		r.close();

	}

}
